<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/5/29
 * Time: 14:18
 */

namespace app\controller;


use app\model\Site;
use think\Controller;
use think\View;
use app\model\ProjectMenu as ProjectMenuModel;
use app\model\PostMenu as PostMenuModel;

class Base extends Controller
{
    public function _initialize()
    {
        $site = Site::get(1);
        $projectMenus = ProjectMenuModel::getMenus();
        $postMenus = PostMenuModel::getMenus();
        View::share([
            'site' => $site,
            'projectMenus' => $projectMenus,
            'postMenus' => $postMenus
        ]);
    }
}